import request from '@/utils/request'

// 获取摊位管理列表
export function fetchStalls(payload) {
  const data = payload
  return request({
    url: 'api/v2/backend/stall',
    method: 'post',
    data
  })
}

// 获取菜场分区
export function fetchPartitions() {
  return request({
    url: '/api/v2/backend/partition',
    method: 'post'
  })
}

// 提交新增摊位
export function submit(payload) {
  const data = payload
  return request({
    url: '/api/v2/backend/stall/add',
    method: 'post',
    data
  })
}

// 提交新增摊位
export function saveEdit(payload) {
  const data = payload
  return request({
    url: '/api/v2/backend/stall/edit',
    method: 'post',
    data
  })
}

export function remove(id) {
  const data = {id}
  return request({
    url: '/api/v2/backend/stall/del',
    method: 'post',
    data
  })
}
